﻿<Window x:Class="ParsecClient.TimerPop"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="TimerPop" Width="250" WindowStyle="None" AllowsTransparency="True" Opacity="1" Topmost="True" ShowInTaskbar="False" Background="Transparent" HorizontalAlignment="Left" VerticalAlignment="Top" ResizeMode="NoResize" SizeToContent="Height">
    <Window.Resources>
        <ResourceDictionary Source="/CustomPopOutResources.xaml" />
    </Window.Resources>
    <Viewbox Name="MyViewBox" HorizontalAlignment="Left" VerticalAlignment="Top">
        <Grid MouseLeftButtonDown="DragWindow" Grid.IsSharedSizeScope="True">
            <Border Style="{StaticResource BackgroundPopoutBorder}" Opacity="1" Margin="10" Name="BorderBackground" />
            <Border Style="{StaticResource BlurPopoutBorder}" Opacity="1" Margin="10" Name="BorderBlur" />
            <Border Style="{StaticResource SolidPopoutBorder}" Opacity="1" Margin="10" Name="BorderSolid" />
            <Border Style="{StaticResource ContentPopoutBorder}" Margin="10" Padding="5" MinWidth="270">
                <StackPanel >
                    <DockPanel LastChildFill="False"  Margin="0 0 0 6">
                        <Button Name="btnIncreaseOpacity" ToolTip="Increase Opacity" Click="btnIncreaseOpacity_Click" DockPanel.Dock="Left" Style="{StaticResource OverlayButton}">
                            <Path Margin="0" Stroke="#FF4acefe" Data="M3,7.5 H12 M7.5,12 V3"  StrokeThickness="2" Height="17" Width="17" />
                        </Button>
                        <Button Margin="2 0 0 0" ToolTip="Decrease Opacity" Name="btnDecreaseOpacity" Click="btnDecreaseOpacity_Click" DockPanel.Dock="Left" Style="{StaticResource OverlayButton}">
                            <Path Margin="0" Stroke="#FF4acefe" Data="M3,7.5 H12"  StrokeThickness="2" Height="17" Width="17" />
                        </Button>
                        <Button Margin="2 0 0 0" Grid.Column="2" Name="btnIncreaseSize" ToolTip="Increase Size" Click="btnIncreaseSize_Click" DockPanel.Dock="Left" Style="{StaticResource OverlayButton}">
                            <Path Margin="0" Stroke="#FF4acefe" Data="M3,7.5 H12 M7.5,12 V3"  StrokeThickness="2" Height="17" Width="17" />
                        </Button>
                        <Button Margin="2 0 0 0" Grid.Column="3" ToolTip="Decrease Size" Name="btnDecreaseSize" Click="btnDecreaseSize_Click" DockPanel.Dock="Left" Style="{StaticResource OverlayButton}">
                            <Path Margin="0" Stroke="#FF4acefe" Data="M3,7.5 H12"  StrokeThickness="2" Height="17" Width="17" />
                        </Button>
                        <Button Width="34" Height="18" FontSize="11" Margin="2 0 0 0"  Grid.Column="3" ToolTip="Clear Current Timers" Name="btnClear" Click="btnClear_Click" DockPanel.Dock="Left" Style="{StaticResource OverlayButton}">Clear</Button>
                        <TextBlock Style="{StaticResource OverlayTextBlur}" Padding="0" Margin="10 0 0 0" DockPanel.Dock="Left">Timers</TextBlock>
                        <Button Name="btnClose" ToolTip="Close" DockPanel.Dock="Right" Click="btnClose_Click" Style="{StaticResource OverlayButton}">
                            <Path Stroke="#FF4acefe" StrokeThickness="2" Margin="0" Height="17" Width="17">
                                <Path.Data>
                                    <PathGeometry>
                                        <PathGeometry.Figures>
                                            <PathFigure StartPoint="3.5,3.5">
                                                <LineSegment Point="11.5,11.5"/>
                                            </PathFigure>
                                            <PathFigure StartPoint="3.5,11.5">
                                                <LineSegment Point="11.5,3.5"/>
                                            </PathFigure>
                                        </PathGeometry.Figures>
                                    </PathGeometry>
                                </Path.Data>
                            </Path>
                        </Button>
                    </DockPanel>
                    <ItemsControl Name="icTimers" ItemsSource="{Binding}" MinHeight="200">
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <Grid Margin="2 0 2 8" x:Name="rowGrid">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <ProgressBar Name="RowTimerProgressBar" Minimum="0" Maximum="100" Value="{Binding Path=PctRemaining, Mode=OneWay}" Grid.Row="1" MinHeight="30" VerticalAlignment="Center" Margin="0 0 0 0" Style="{StaticResource PopOutProgress}"></ProgressBar>
                                    <StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="1">
                                        <TextBlock Text="{Binding Path=SecondsRemaining, StringFormat='{}{0:N1}', Mode=OneWay}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="4 0 0 0" Style="{StaticResource OverlayTextBig}" FontSize="18"></TextBlock>
                                        <TextBlock Padding="0 0 0 1" HorizontalAlignment="Left" VerticalAlignment="Center" Style="{StaticResource OverlayText}" Text="{Binding Path=Name, Mode=OneWay}" FontSize="14" Margin="10 0 0 0"></TextBlock>
                                    </StackPanel>
                                </Grid>
                                <DataTemplate.Triggers>
                                    <DataTrigger Binding="{Binding Path=TimerColorValue}" Value="1">
                                        <Setter Property="Style" Value="{StaticResource PopOutProgressRed}" TargetName="RowTimerProgressBar"></Setter>
                                    </DataTrigger>
                                </DataTemplate.Triggers>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </StackPanel>
            </Border>
        </Grid>
    </Viewbox>
</Window>
